/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.node;

import 解析.Matcher;

/**
 *
 * @author yanxi
 */
public class End extends Node {

    @Override
    public boolean match(Matcher matcher, int i, CharSequence seq) {
        int endIndex = (matcher.anchoringBounds) ? matcher.to : matcher.getTextLength();
        if (i == endIndex) {
            matcher.hitEnd = true;
            return next.match(matcher, i, seq);
        }
        return false;
    }
    
    @Override
    public String toString(){
        return "\\z";
    }
}
